﻿<UserControl x:Class="OSChina.Controls.CommentListControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
             xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="480" d:DesignWidth="480">

    <UserControl.Resources>
        <DataTemplate x:Key="template_Normal">
            <Grid Margin="0,16,0,20">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="70" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <!-- 头像 -->
                <Image Name="img" Width="50" Height="50" VerticalAlignment="Top" Margin="0,7,0,0" Source="{Binding portrait,Mode=OneTime}" MouseLeftButtonUp="img_MouseLeftButtonUp" />
                <StackPanel x:Name="panel"  Grid.Column="1" Margin="5,0,0,0">
                    <TextBlock Style="{StaticResource style_TitleText}" Text="{Binding source,Mode=OneTime}" FontSize="25" Margin="0,0,0,5" HorizontalAlignment="Left" Width="390" />
                    <StackPanel x:Name="panel_refer" Loaded="panel_Loaded" Visibility="Collapsed" HorizontalAlignment="Left" Width="390" />
                    <TextBlock Style="{StaticResource style_DefaultText}" Text="{Binding content,Mode=OneTime}" FontSize="23" Foreground="Black" Width="390" Margin="0,0,0,7" />
                    <StackPanel x:Name="panel_repiles" Loaded="panel_Loaded" Visibility="Collapsed" HorizontalAlignment="Left" Width="390" />
                    <TextBlock Visibility="{Binding appClientVisible,Mode=OneTime}" Text="{Binding appClientString,Mode=OneTime}" HorizontalAlignment="Left" Foreground="Gray" Margin="0,4,0,0" FontSize="19"  />
                </StackPanel>
                <toolkit:ContextMenuService.ContextMenu>
                    <toolkit:ContextMenu>
                        <toolkit:MenuItem x:Name="menu_Delete" Header="删除评论" Click="menu_Delete_Click" />
                    </toolkit:ContextMenu>
                </toolkit:ContextMenuService.ContextMenu>
            </Grid>
        </DataTemplate>
    </UserControl.Resources>
    
    <Grid x:Name="LayoutRoot">
        <ListBox Name="list_Comment" ItemTemplate="{StaticResource template_Normal}" SelectionChanged="list_Comment_SelectionChanged">
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <VirtualizingStackPanel CacheMode="BitmapCache"/>
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
        </ListBox>
    </Grid>
</UserControl>
